<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" type="text/css" href="{%$templates%}/admin-v2.css" />
   <script type="text/javascript" src="/lib/fckeditor/fckeditor.js"></script>
   <script type="text/javascript" src="{%$library%}/jquery.js"></script>
   <script type="text/javascript" src="{%$templates%}/js/meccano.js"></script>
</head>

<body{%if $make eq true%} onload="setTimeout('Redirector();',1500);"{%/if%}>
<div align='center'>
{%if $make eq true%}

<br /><br /><font color='green'>Все сохранено!</font>

{%else%}
<div class='box' style="width:800px;">
   <div class='h4_bg'>
   <div class='corn_tr'>
      <div class='corn_tl'>
         <h4>Ввод данных</h4>
      </div>
   </div>
   </div>
   <div class='content'>
   
   <form enctype='multipart/form-data' action='catalogue.php?e=11' method='POST'>
   {%section loop=$tableInfo.hidden name=i%}
      <input type='hidden' name='{%$tableInfo.hidden[i].name%}' value='{%$vars.id|default:""%}' />
   {%/section%}
   {%section loop=$tableInfo.fields name=i%}
   {%assign var='v_key' value=$tableInfo.fields[i].name%}
   {%if $smarty.section.i.first%} 
      <table border='0'>
   {%/if%}

      <tr>
         <td align='right' valign='top'>
            {%$tableInfo.fields[i].title%}
            {%if $tableInfo.fields[i].required eq 1%}<span class='warn'>*</span>{%/if%}:
         </td>
         <td align='left'>

            {%if $v_key eq 'lang'%}

               {%include file='servlet.lang.html' onchange=0%}

            {%elseif $v_key eq 'cat'%}

               {%include file='servlet.cat.html' folder=0 category=$vars.cat|default:''%}

            {%elseif $tableInfo.fields[i].property neq 0%}
               
               {%assign var='property' value=$tableInfo.fields[i].property.list%}
               {%section loop=$property name='p'%}
                  {%if $tableInfo.fields[i].form eq 'select'%}
                     {%if $smarty.section.p.first%}
                     <select name='{%$tableInfo.fields[i].name%}' id='{%$tableInfo.fields[i].name%}'>
                        <option value=''>-- Характеристика? --</option>
                     {%/if%}
                        <option value='{%$property[p].id%}'{%if $vars[$v_key]|default:$tableInfo.fields[i].value eq $property[p].id%} selected{%/if%}>{%$property[p].title%}</option> 
                     {%if $smarty.section.p.last%}
                     </select>
                     {%/if%}
                  {%elseif $tableInfo.fields[i].form eq 'radio'%}
                     <input type='radio' name='{%$tableInfo.fields[i].name%}' value='{%$property[p].id%}' id='r_{%$property[p].id%}' {%if $vars[$v_key]|default:'' eq $property[p].id%} checked{%/if%} />
                     <label for='r_{%$property[p].id%}'> - {%$property[p].title%}</label><br />
                  {%/if%}
               {%/section%}
            {%elseif $tableInfo.fields[i].form eq 'data'%}

               {%html_select_date field_order="DMY" field_array=$tableInfo.fields[i].name time=$vars[$v_key] end_year='+2'%}

            {%elseif $tableInfo.fields[i].form eq 'textarea'%}

               <textarea name='{%$tableInfo.fields[i].name%}'>{%$vars[$v_key]|default:$tableInfo.fields[i].value%}</textarea>
            {%elseif $tableInfo.fields[i].form eq 'editor:plane'%}
               <script>
                  var sBasePath = '/lib/fckeditor/';
                  var oFCKeditor = new FCKeditor('{%$tableInfo.fields[i].name%}');
                  oFCKeditor.BasePath = sBasePath;
                  oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'm_config.js';
                  oFCKeditor.ToolbarSet = 'Plane';
                  oFCKeditor.Height = 170;
                  oFCKeditor.Width  = 420;
                  oFCKeditor.Create();
               </script>
            {%elseif $tableInfo.fields[i].form eq 'editor:basic'%}
               <script>
                  var sBasePath = '/lib/fckeditor/';
                  var oFCKeditor = new FCKeditor('{%$tableInfo.fields[i].name%}');
                  oFCKeditor.BasePath = sBasePath;
                  oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'm_config.js';
                  oFCKeditor.ToolbarSet = 'Basic';
                  oFCKeditor.Height = 350;
                  oFCKeditor.Width  = 500;
                  oFCKeditor.Create();
               </script>
            {%elseif $tableInfo.fields[i].form eq 'editor:simple'%}
               <script>
                  var sBasePath = '/lib/fckeditor/';
                  var oFCKeditor = new FCKeditor('{%$tableInfo.fields[i].name%}');
                  oFCKeditor.BasePath = sBasePath;
                  oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'm_config.js';
                  oFCKeditor.ToolbarSet = 'Simple';
                  oFCKeditor.Height = 500;
                  oFCKeditor.Width  = 500;
                  oFCKeditor.Create();
               </script>
            {%elseif $tableInfo.fields[i].form eq 'editor:advanced'%}
               <script>
                  var sBasePath = '/lib/fckeditor/';
                  var oFCKeditor = new FCKeditor('{%$tableInfo.fields[i].name%}');
                  oFCKeditor.BasePath = sBasePath;
                  oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'm_config.js';
                  oFCKeditor.ToolbarSet = 'Advanced';
                  oFCKeditor.Height = 700;
                  oFCKeditor.Width  = 700;
                  oFCKeditor.Create();
               </script>
            {%else%}

            <input name='{%$tableInfo.fields[i].name%}' type='{%$tableInfo.fields[i].form%}' style='width:300px;' value='{%$vars[$v_key]|default:$tableInfo.fields[i].value%}' />
            {%/if%}
         </td>
      </tr>

   {%if $smarty.section.i.last%} 
      <tr>
         <td>
         </td>
         <td align='left' valign='top'>
            <input type='submit' name='submit' value=' Сохранить ' />
         </td>
      </tr>
      </table>
   {%/if%}
   {%/section%}
   </form>

</form>
</div>
</div>
{%/if%}
</div>
</body>
</html>